<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Insert title here</title>
		<link href="css/table.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
		<script type="text/javascript" src="js/kindeditor/kindeditor-min.js"></script>
		<script type="text/javascript" src="js/kindeditor/lang/zh_CN.js"></script>
		<script type="text/javascript" src="js/openwindow.js"></script>
		<script type="text/javascript" src="js/file.js"></script>
		<script type="text/javascript" src="js/info.js"></script>
		<script type="text/javascript">
			function selectorg(){
				var url="orgByFlow.action";
				openWindow(url,650,550);
			}
			
	 function setValue(value){
	  var arr = eval(value);
	  var names = "";
	  var ids = "";
	  for(i=0;i<arr.length;i++){
	    ids =  ids + "," + arr[i].value;
	    names = names + "," + arr[i].name;
	  }
	  if(names.length>0){
	    names = names.substring(1);
	    ids =  ids.substring(1);
	  }
	  document.getElementById("names").value=names;
	  document.getElementById("ids").value=ids;
	}
	
	function getOldValue(){
  var ids=document.getElementById("ids").value;
  var names=document.getElementById("names").value;
    var array="";
  if(ids!=''&&ids!='null'){
  var idarray=ids.split(",");
  var namearray=names.split(",");
  for(var i=0;i<idarray.length;i++){
  		if(i==0){
  			array+="{\"value\":"+idarray[i]+",\"name\":\""+namearray[i]+"\"}";
  		}else{
  	      array+=",{\"value\":"+idarray[i]+",\"name\":\""+namearray[i]+"\"}";
  	   } 
  }
  }
  return array;
}
		$(function(){
			$.post("getTemplate.action",null,function(data){
				var list =data.tempObjectList;
				var fnfoot="";
				var info="<option value='选择'>选择</option>";
				for(var i=0;i<list.length;i++){
					var obj = list[i];
					info+="<option value=\""+i+"\">"+obj[1]+"</option>";
					fnfoot+="<input type='hidden' value='"+obj[4]+"' id='"+i+"' /> ";
				}
				$("#template").html(info);
				$("#info_2").html(fnfoot)
			},"json");
		});
		
		function select(obj){
			editor.html('');
			var a =$("#template").val();
			if(a!='选择'){
				var c = $("#"+a).val();
				editor.appendHtml(c);
				$("#tempName").val(obj.options[obj.selectedIndex].text);
			}
		}
		</script>
	</head>
	<body>
		<form action="InformationReportSendInformation.action" name="saveForm" method="post">
		<input type="hidden" name="tempName" id="tempName" >
			<input type="hidden" id="fileArray" name="info.fileId" value="${info.fileId}">
			<span id="info_2"></span>
			<table align="center" border="0" cellpadding="0" cellspacing="0" width="98%">
				<tbody>
					<tr>
						<td style="background: url('image/wsoa_window_002.gif');" width="1"></td>
						<td style="background: url('image/wsoa_window_002.gif');">
							<table border="0" cellpadding="0" cellspacing="0">
								<tbody>
									<tr>
										<td align="center" style="background: url('image/wsoa_window_002.gif');" width="10">
											<img src="image/center_19.gif">
										</td>
										<td align="center" style="background: url('image/wsoa_window_002.gif');"></td>
										<td>信息管理 &gt; 个人信息 &gt; 信息上报</td>
									</tr>
								</tbody>
							</table>
						</td>
						<td style="background: url('image/wsoa_window_002.gif');" width="1"></td>
					</tr>
					<tr>
						<td style="background: url('image/wsoa_window_010.gif');" width="1">
							&nbsp;
						</td>
						<td>

							<div id="bottom">
								<table style="width: 100%;" class="table5">
									<tbody>
										<tr>
											<td class="table5 bgcolor5" align="right" width="80px">
												栏目
											</td>
											<td class="table5" align="left" width="100px">
												<s:select id="column" list="columns" cssStyle="width:100px;" listKey="id" listValue="name" name="info.columnId" value="info.columnId" theme="simple" headerKey="" headerValue="--请选择--">
												</s:select>
											</td>
											<td class="table5 bgcolor5" align="right" width="30px">
												模版
											</td>
											<td class="table5" align="left">
												<select onchange="select(this)" id="template" style="width: 100px">
												</select>
											</td>
										</tr>
										<tr>
											<td class="table5 bgcolor5" align="right" >
												主 题
											</td>
											<td   colspan="3" align="left">
												<input  class="textinput" id="title" name="info.title" title="最多不超过50字符" maxlength="50" />
											</td>
										</tr>
											<tr>
											<td class="table5 bgcolor5" align="right" >适用范围</td>
											<td colspan="3">
											<textarea class="textinput" readonly="readonly" id="names" name="names" >${names }</textarea><br/>
											<input type="hidden" id="ids" name="users" value="${users}">
											<a href="javascript:selectorg()">添加部门</a>
											</td>
										</tr>
										<tr>
											<td class="table5 bgcolor5" align="right">
												内容
											</td>
											<td class="table5" colspan="3" align="left">
												<textarea  name="content" id="content" style="width: 100%; height: 300px; visibility: hidden;">${info.content}</textarea>
											</td>
										</tr>
										<tr>
											<td class="table5 bgcolor5" align="right">
												附件
											</td>
											<td class="table5" colspan="3" align="left">
												<a href="javascript:file_upload('filetable')">添加附件</a>&nbsp;&nbsp;
												<a href="javascript:fileDel('filetable')">删除</a>
											</td>
										</tr>
										<tr>
											<td class="table5 bgcolor5" align="right" width="80"></td>
											<td class="table5" colspan="3" align="left">
												<table id="filetable" style="border: #cddee9 double 2px; width: 605px">

												</table>
											</td>
										</tr>
									</tbody>
								</table>
								<table style="width: 100%;" align="center" border="0">
									<tbody>
										<tr>
											<td align="center">
												<input class="button_04" type="button"
													onclick="infoSaveUpdate('save')" value="保存" />
												&nbsp;&nbsp;
												<input class="button_04" type="button"
													onclick="window.location.href='infoListAll.action'"
													value="返回" />
										</tr>
									</tbody>
								</table>
							</div>
							
						</td>
						<td style="background: url('image/wsoa_window_006.gif');"
							width="1">
							&nbsp;
						</td>
					</tr>
					<tr>
						<td height="1" width="1">
							<img src="image/wsoa_window_009.gif" height="16" width="14">
						</td>
						<td style="background: url('image/wsoa_window_008.gif');"
							height="1"></td>
						<td height="1" width="1">
							<img src="image/wsoa_window_007.gif" height="16" width="12">
						</td>
					</tr>
				</tbody>
			</table>
		</form>
	</body>

</html>